package com.hou.houlymall.cart.service;

import com.hou.houlymall.cart.vo.Cart;
import com.hou.houlymall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @author H
 * @create 2021-08-16 18:10
 */
public interface CartService {
    /**
     * 获取整个购物车
     * @return ...
     * @throws ExecutionException ...
     * @throws InterruptedException ...
     */
    Cart getCart() throws ExecutionException, InterruptedException;

    /**
     * 给购物车里添加数据
     * @param skuId ...
     * @param num ...
     * @return ...
     * @throws ExecutionException ...
     * @throws InterruptedException ...
     */
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /**
     *
     * @param cartKey
     */
    void clearCart(String cartKey);

    /**
     * 获取购物车中某个购物项
     * @param skuId ...
     * @return ...
     */
    CartItem getCartItem(Long skuId);

    /**
     * 勾选购物项
     * @param skuId ...
     * @param check ...
     */
    void checkItem(Long skuId, Integer check);

    /**
     * 修改购物项数量
     * @param skuId
     * @param num
     */
    void changeItem(Long skuId, Integer num);

    /**
     * 删除购物项
     * @param skuId
     */
    void deleteItem(Long skuId);

    List<CartItem> getUserCartItems();
}
